package br.ufc.ck0017.temp;


public class Temp {
    private Color color;
    private final String name;
    private static int counter = 0;

    public Temp() {
        name = "t" + counter++;
    }

    public Temp(Color color) {
        this.color = color;
        name = color.toString();
    }

    public String getName() {
        return name;
    }

    public Color getColor() {
        return color;
    }

    public void setColor(Color color) {
        if (this.color != null) {
            throw new IllegalStateException("This temp has been colorized already!");
        }

        if (color == null) {
            throw new IllegalArgumentException("Can't assign a null color.");
        }

        this.color = color;
    }
}
